const path = require('path')
let NODE_ENV = process.env.NODE_ENV // development、test、pre、production
// let SCSS_ENV = '$env: ' + NODE_ENV + ';'
let SCSS_ENV = `$env: ${NODE_ENV};`

module.exports = {
    assetsDir: 'assets',
    productionSourceMap: false,
    // devServer: {
    //     port: 8100 // 端口号
    // }
    configureWebpack: {
        externals: {
            // 'vue': 'Vue',
            // 'Vue': 'vue',
            // 'vue-router': 'VueRouter',
            // 'vuex': 'Vuex',
            // 'element-ui': 'ELEMENT'
            // 'axios': 'Axios'
            // 'element-ui': 'ElementUI'
            // 'element-ui': 'element-ui'
        }
    },
    css: {
        loaderOptions: {
            sass: {
                data: SCSS_ENV + `@import "@/assets/scss/variables.sass";`
            }
        }
    },
    pluginOptions: {
        'style-resources-loader': {
            preProcessor: 'scss',
            patterns: [
                path.resolve(__dirname, 'src/assets/scss/mixin.scss'),
                path.resolve(__dirname, 'src/assets/scss/function.scss')
            ]
        }
    }
}
